package com.ethan.java8;

/**
 * @author ethan
 * create 2018-08-03 上午10:45
 * desc
 **/
public class Test3 {
    public static void main(String[] args) {
        final Value<String> value = new Value<>();
        String str = value.getOrDefault("abc",Value.defaultValue());

        String a ="";
    }

}

class Value<T> {
    public static <T> T defaultValue() {
        return null;
    }

    public T getOrDefault(T value, T defaultValue) {
        return (value != null) ? value : defaultValue;
    }
}
